#ifndef TEST_FIXTURE_HPP
#define TEST_FIXTURE_HPP

#include <boost/test/included/unit_test.hpp>

#include "wrapper.hpp"

// 通用测试夹具类
class CLTestFixture {
public:
    CLTestFixture()
    {
        init_result_ = cl_.Init();
        BOOST_TEST_REQUIRE(init_result_);

        context_ = cl_.GetContext();
        BOOST_TEST_REQUIRE(context_);

        queue_ = cl_.GetQueue();
        BOOST_TEST_REQUIRE(queue_);

        device_ = cl_.GetDeviceID();
        BOOST_TEST_REQUIRE(device_);

        platform_ = cl_.GetPlatformID();
        BOOST_TEST_REQUIRE(platform_);
    }

    ~CLTestFixture() { cl_.DeInit(); }

    CLWrapper        cl_;
    cl_context       context_;
    cl_command_queue queue_;
    cl_device_id     device_;
    cl_platform_id   platform_;
    bool             init_result_;
};

#endif